SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE VIEW dbo.vw_RegistroDeLiquidacionesPorNivel2
AS
SELECT O.idOrganizaciones, O.Nombre, L.localidad, 
    CASE WHEN O.CUISE IN (9828, 9812, 9840, 9879, 9880, 9853, 
    9847, 9873, 9843) 
    THEN 'Privado Subvencionado (TP)' ELSE 'Privado Subvencionado Transferido (TT)'
     END AS Presupuesto, Mes, Anio, EGB AS EGB, 
    Polimodal AS Polimodal, Superior AS Superior, AnexoI, 
    AnexoII AS BLP, AnexoIII AS ISS, ATransferir AS ATransferir,  
    tb_ValoresDeSubsidios2.Tipo AS Tipo, EstimuloEGB+Estimulo2EGB As EstimuloEGB, EstimuloPOLIMODAL + Estimulo2POLIMODAL As EstimuloPOLIMODAL , EstimuloSUPERIOR+Estimulo2SUPERIOR as EstimuloSUPERIOR, TotalEstimulo +TotalEstimulo2 as TotalEstimulo
FROM tb_Organizaciones O INNER JOIN
    tb_Localidades L ON L.idLocalidad = O.Localidad INNER JOIN
    tb_ValoresDeSubsidios2 ON 
    idOrganizaciones = Organizacion
WHERE (O.EsPrivada = 'S')






GO
GRANT SELECT ON  [dbo].[vw_RegistroDeLiquidacionesPorNivel2] TO [SoloVer]
GO
